A computer software operating system controls the execution of programs and may provide services such as memory management. An operating system is generally designed for a particular system architecture and for a particular application or environment. For example, the UNIX operating system is designed primarily for a multiple user environment.
A multiple user system generally permits multiprogramming wherein more than a single process resides in the main memory at the same time. Multiprogramming requires a division or partitioning of memory commonly referred to as memory management. A known memory management technique, which is used by UNIX, is known as paging. Paging involves the partitioning of memory into equal fixed-size chunks known as frames and the division of each process into the same size chunks known as pages. Pages are allocated to frames which are distributed throughout the memory. In order to keep track of the physical location of each memory page, the operating system maintains a page table. The page table includes a number of entries, referred to as page table entries, each of which shows the frame location for each page of a process. Each process operates with logical addresses which include a page number and relative address within the page. In order to access a memory page, the page number is used to address an entry in the page table in order to obtain the frame location.
In addition to containing the frame location, each page table entry includes a number of control bits. These additional bits are divided into hardware control bits and software control bits. The hardware control bits are used to generate various control signals. Two of these bits are used to control access to the data. For example, the bits can define a read only condition in which case the data page cannot be written to, a write only condition wherein the data page cannot be read, or the bits can define a read/write condition in which case the data page can be read or written to. The software control bits do not generate a control signal per se, but rather contain information that may be examined by software. Typical software control bits are so-called "aging" bits which track how recently a page has been used. When new pages need to be moved into memory, these aging bits are analyzed by a least recently used (LRU) algorithm to determine which pages to remove from the memory.
A feature of the UNIX operating system is that two or more processes may share the same data page. However, before one of the processes is permitted to write to the shared page, the page must first be copied. After copying the page, the process may modify its copy (which is no longer shared with the other processes). In the past, the software control bits in the page table entry have included a "copy-on-write" bit. This copy-on-write bit provides information as to whether or not the particular page has been previously copied. In prior UNIX systems, when a data page is accessed for a write operation, the data access (hardware control) bits in the page table entry generate an error signal if the bits indicate a read only page. The software then determines whether the copy-on-write bit is set. If the copy-on-write bit is set, the page is copied and the process continues. If the copy-on-write bit is not set, the read only error signal is valid and no modification of the page may be effected.
A problem with the existing systems is that when a read only error is generated, the copy-on-write bit must always be checked by the system software. The copy-on-write bit check is carried out only after the read only error is generated. This introduces a delay into the system operation. In addition, the number of software bits in a page table entry are limited in the UNIX operating system. Such software bits as are available are particularly valuable as aging bits because more aging bits allow more powerful and efficient LRU algorithms.